package listener;

import java.util.Map;

import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;

import com.alibaba.fastjson.JSONObject;
import com.util.Serial;

public class PayLinstener implements ServletContextListener {
	
	public static JSONObject map ;
	
	public void contextDestroyed(ServletContextEvent evt) {
		System.out.println("服务器关闭时时调用该方法");
		try {
		//调用该方法
			map=null;
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}

	public void contextInitialized(ServletContextEvent evt) {
		System.out.println("服务器启动时时调用该方法");
		try {
			map = Serial.解密();
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
	
	public static void reload() {
		map = Serial.解密();
	}
}
